<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Version Information</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="prev" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="next" href="glib-Basic-Types.html" title="Basic Types">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-fundamentals.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Basic-Types.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#glib-Version-Information.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#glib-Version-Information.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Version Information">
<a name="glib-Version-Information"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-Version-Information.top_of_page"></a>Version Information</span></h2>
<p>Version Information — Variables and functions to check the GLib version</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="glib-Version-Information.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;glib.h&gt;

#define             <a class="link" href="glib-Version-Information.html#GLIB-MAJOR-VERSION:CAPS" title="GLIB_MAJOR_VERSION">GLIB_MAJOR_VERSION</a>
#define             <a class="link" href="glib-Version-Information.html#GLIB-MINOR-VERSION:CAPS" title="GLIB_MINOR_VERSION">GLIB_MINOR_VERSION</a>
#define             <a class="link" href="glib-Version-Information.html#GLIB-MICRO-VERSION:CAPS" title="GLIB_MICRO_VERSION">GLIB_MICRO_VERSION</a>
#define             <a class="link" href="glib-Version-Information.html#GLIB-CHECK-VERSION:CAPS" title="GLIB_CHECK_VERSION()">GLIB_CHECK_VERSION</a>                  (major,
                                                         minor,
                                                         micro)
</pre>
</div>
<div class="refsect1" title="Description">
<a name="glib-Version-Information.description"></a><h2>Description</h2>
<p>
GLib provides version information, primarily useful in configure checks
for builds that have a configure script. Applications will not
typically use the features described here.
</p>
</div>
<div class="refsect1" title="Details">
<a name="glib-Version-Information.details"></a><h2>Details</h2>
<div class="refsect2" title="GLIB_MAJOR_VERSION">
<a name="GLIB-MAJOR-VERSION:CAPS"></a><h3>GLIB_MAJOR_VERSION</h3>
<pre class="programlisting">#define GLIB_MAJOR_VERSION 2
</pre>
<p>
The major version number of the GLib library.
Like <a href="http://library.gnome.org/devel/glib/unstable/glib-Version-Information.html#glib-major-version"><span class="type">glib_major_version</span></a>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</p>
</div>
<hr>
<div class="refsect2" title="GLIB_MINOR_VERSION">
<a name="GLIB-MINOR-VERSION:CAPS"></a><h3>GLIB_MINOR_VERSION</h3>
<pre class="programlisting">#define GLIB_MINOR_VERSION 26
</pre>
<p>
The minor version number of the GLib library.
Like <a href="http://library.gnome.org/devel/gtk/unstable/gtk-Feature-Test-Macros.html#gtk-minor-version"><span class="type">gtk_minor_version</span></a>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</p>
</div>
<hr>
<div class="refsect2" title="GLIB_MICRO_VERSION">
<a name="GLIB-MICRO-VERSION:CAPS"></a><h3>GLIB_MICRO_VERSION</h3>
<pre class="programlisting">#define GLIB_MICRO_VERSION 1
</pre>
<p>
The micro version number of the GLib library.
Like <a href="http://library.gnome.org/devel/gtk/unstable/gtk-Feature-Test-Macros.html#gtk-micro-version"><span class="type">gtk_micro_version</span></a>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</p>
</div>
<hr>
<div class="refsect2" title="GLIB_CHECK_VERSION()">
<a name="GLIB-CHECK-VERSION:CAPS"></a><h3>GLIB_CHECK_VERSION()</h3>
<pre class="programlisting">#define             GLIB_CHECK_VERSION(major,minor,micro)</pre>
<p>
Checks the version of the GLib library.
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the version of the GLib header files is the same
as or newer than the passed-in version.
</p>
<div class="example">
<a name="id640655"></a><p class="title"><b>Example 1. Checking the version of the GLib library</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="function"><a href="glib-Version-Information.html#GLIB-CHECK-VERSION:CAPS">GLIB_CHECK_VERSION</a></span><span class="normal"> </span><span class="symbol">(</span><span class="number">1</span><span class="symbol">,</span><span class="normal"> </span><span class="number">2</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">))</span>
<span class="normal">  </span><span class="function"><a href="glib-Message-Logging.html#g-error">g_error</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"GLib version 1.2.0 or above is needed"</span><span class="symbol">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<p><br class="example-break">
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>major</code></em> :</span></p></td>
<td>the major version number.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>minor</code></em> :</span></p></td>
<td>the minor version number.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>micro</code></em> :</span></p></td>
<td>the micro version number.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>